package org.csmzxy.class2334.stringclass;

public class Example04 {
    public static void main(String[] args){
        String username1 = "heimal2345!";
        String username2 = "Heimal2345!";
        System.out.println("字符串" + username1 + "是否以hheima开头：" + username1.startsWith("heima"));
        System.out.println("字符串" + username1 + "是否以!结尾：" + username1.endsWith("!"));
        System.out.println("字符串" + username1 + "是否为空：" + username1.isEmpty());
        System.out.println("字符串" + username1 + "是否包含字符串123：：" + username1.contains("123"));
        System.out.println("字符串" + username1 + "," + username2 + "内容是否相同：" + username1.equals(username2));
        System.out.println("忽略字符大小1写判断字符串" + username1 + "," + username2 + "内容是否相同：" + username1.equalsIgnoreCase(username2));
        System.out.println("按Unicode比较字符串" + username1 + "," + username2 +"的大小" + username1.compareTo(username2));
    }
}
